Hardware for a local area network (LAN) service processor manages access to the physical LAN network on a particular electronic device. A corresponding LAN software driver works in conjunction with the LAN hardware driver to process the data stored in memory by the LAN hardware driver.
Both the LAN hardware driver and the LAN software driver have synchronized buffer indices that indicate which memory buffer in a ring of buffer memories the corresponding hardware or software will access. With normal data processing when the buffer indices are synchronized, the LAN software driver would receive an interrupt from the LAN hardware driver that a new LAN data packet was received and ready for processing. The LAN software driver would check its buffer index and find the new data to process.
Normally, LAN packets of data received by the LAN hardware driver for processing are stored into available buffer memories in a one-to-one relationship, e.g., one memory buffer will contain one LAN data packet. As such, a memory buffer contains approximately 1600 bytes to accommodate for LAN data packets that are standardized to a maximum size of 1500 bytes. An extra 100 bytes are available for overhead to provide for alignment and memory, etc.
However, the LAN hardware driver will occasionally and incorrectly store separate data packets into the same memory buffer, possibly separated by any number of 4-byte values. The multiple LAN data packets overwrite pointers in the buffer memory. For example, due to timing differences amongst various buses and overloading from too many incoming LAN data packets, the LAN hardware driver will occasionally miss the end-of-packet marker. As a result, a single memory buffer could contain multiple LAN data packets. The multiple LAN packets are concatenated into a single memory buffer and are each complete for processing. In addition, the concatenated LAN data packets may not necessarily immediately follow the previous LAN data packet. Concatenation is used within the context of a LAN data packet located in an incorrect location, other than the beginning, in the memory buffer.
When the LAN hardware driver misses the end-of-packet marker, the LAN hardware driver will continue to store bytes into the Direct Access Memory (DMA) buffer memories. The LAN hardware driver stores the first 4 bytes for every LAN packet received from the LAN network until the LAN hardware driver receives a second LAN data packet that is either a Media Access Control (MAC) broadcast packet or a packet directed to the MAC address of the LAN hardware driver. When the end-of-packet marker for the second LAN data packet is not overridden by other concatenated LAN data packets, the LAN hardware driver is signaled that the associated memory buffer is ready for processing.
Prior Art FIG. 1 illustrates a memory buffer 100 containing multiple LAN data packets that are concatenated. Buffer memory 100 contains LAN data packets 510, 530 and 535. Concatenated LAN data packets may or may not immediately follow other LAN data packets. In addition, any number of LAN data packets may be concatenated. For example, noise data 540 is stored in 4 byte increments and contains the first 4 bytes of every LAN packet received from the LAN network between LAN data packet 510 and LAN data packet 530. However, LAN data packet 530 is immediately followed by LAN data packet 535. As a result, the three LAN data packets are concatenated within the memory buffer 100.
The LAN data packet 535 has an end-of-packet marker that has not been overwritten and that has been acknowledged by the LAN hardware driver. As a result, other LAN data packets are not concatenated within the memory buffer 100.
Unfortunately, when the buffer memory containing multiple LAN data packets that are concatenated is processed, only the first LAN data packet at the beginning of the memory buffer is processed. The remaining concatenated LAN data packets are ignored and lost. Not only does this lead to lost data, but the LAN hardware driver may crash, especially when the LAN hardware driver is overloaded with too many incoming LAN data packets.